package com.ae.shield.generator;

import com.ae.shield.common.items.ItemList;
import net.minecraft.data.BlockTagsProvider;
import net.minecraft.data.DataGenerator;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.common.data.ForgeItemTagsProvider;

import static com.ae.shield.common.tag.ModTags.Forge.Item.*;
import static com.ae.shield.common.tag.ModTags.Mod.Item.PLASTIC;

public class ModItemTagsProvider extends ForgeItemTagsProvider {
    public ModItemTagsProvider(DataGenerator gen, BlockTagsProvider blockTagProvider, ExistingFileHelper existingFileHelper) {
        super(gen, blockTagProvider, existingFileHelper);
    }

    @Override
    public void registerTags() {
        //矿石物品
        getOrCreateBuilder(ORES_TIN).add(ItemList.ORES_TIN.get());
        getOrCreateBuilder(ORES_LEAD).add(ItemList.ORES_LEAD.get());
        getOrCreateBuilder(ORES_ALUMINUM).add(ItemList.ORES_ALUMINUM.get());
        getOrCreateBuilder(ORES_SILVER).add(ItemList.ORES_SILVER.get());
        getOrCreateBuilder(ORES_MANGANESE).add(ItemList.ORES_MANGANESE.get());
        getOrCreateBuilder(ORES_TANTALUM).add(ItemList.ORES_TANTALUM.get());
        //粒
        getOrCreateBuilder(NUGGETS_ENDERIUM).add(ItemList.NUGGETS_ENDERIUM.get());
        getOrCreateBuilder(NUGGETS_NANO).add(ItemList.NUGGETS_NANO.get());
        //线
        getOrCreateBuilder(WIRES_IRON).add(ItemList.WIRES_IRON.get());
        getOrCreateBuilder(WIRES_GOLD).add(ItemList.WIRES_GOLD.get());
        getOrCreateBuilder(WIRES_NANO).add(ItemList.WIRES_NANO.get());
        //粉
        getOrCreateBuilder(DUSTS_IRON).add(ItemList.DUSTS_IRON.get());
        getOrCreateBuilder(DUSTS_ALUMINUM).add(ItemList.DUSTS_ALUMINUM.get());
        getOrCreateBuilder(DUSTS_SILVER).add(ItemList.DUSTS_SILVER.get());
        getOrCreateBuilder(DUSTS_GOLD).add(ItemList.DUSTS_GOLD.get());
        getOrCreateBuilder(DUSTS_MANGANESE).add(ItemList.DUSTS_MANGANESE.get());
        getOrCreateBuilder(DUSTS_TANTALUM).add(ItemList.DUSTS_TANTALUM.get());
        getOrCreateBuilder(DUSTS_ENDERIUM).add(ItemList.DUSTS_ENDERIUM.get());
        //锭
        getOrCreateBuilder(INGOTS_TIN).add(ItemList.INGOTS_TIN.get());
        getOrCreateBuilder(INGOTS_LEAD).add(ItemList.INGOTS_LEAD.get());
        getOrCreateBuilder(INGOTS_ALUMINUM).add(ItemList.INGOTS_ALUMINUM.get());
        getOrCreateBuilder(INGOTS_SILVER).add(ItemList.INGOTS_SILVER.get());
        getOrCreateBuilder(INGOTS_MANGANESE).add(ItemList.INGOTS_MANGANESE.get());
        getOrCreateBuilder(INGOTS_TANTALUM).add(ItemList.INGOTS_TANTALUM.get());
        getOrCreateBuilder(INGOTS_ENDERIUM).add(ItemList.INGOTS_ENDERIUM.get());
        getOrCreateBuilder(INGOTS_NANO).add(ItemList.INGOTS_NANO.get());
        //板
        getOrCreateBuilder(PLATES_LEAD).add(ItemList.PLATES_LEAD.get());
        getOrCreateBuilder(PLATES_IRON).add(ItemList.PLATES_IRON.get());
        getOrCreateBuilder(PLATES_GOLD).add(ItemList.PLATES_GOLD.get());
        getOrCreateBuilder(PLATES_DENSE_LEAD).add(ItemList.PLATES_DENSE_LEAD.get());
        getOrCreateBuilder(PLATES_ENDERIUM).add(ItemList.PLATES_ENDERIUM.get());
        getOrCreateBuilder(PLATES_DENSE_ENDERIUM).add(ItemList.PLATES_DENSE_ENDERIUM.get());
        getOrCreateBuilder(PLATES_NANO).add(ItemList.PLATES_NANO.get());
        getOrCreateBuilder(PLATES_DENSE_NANO).add(ItemList.PLATES_DENSE_NANO.get());
        //电路板
        getOrCreateBuilder(CIRCUITS_BASIC).add(ItemList.CIRCUITS_BASIC.get());
        getOrCreateBuilder(CIRCUITS_ADVANCED).add(ItemList.CIRCUITS_ADVANCED.get());
        getOrCreateBuilder(CIRCUITS_ELITE).add(ItemList.CIRCUITS_ELITE.get());
        //绝缘材料（塑料）
        getOrCreateBuilder(PLASTIC).add(ItemList.INSULATION.get());
        getOrCreateBuilder(PLASTIC).addOptionalTag(new ResourceLocation("forge:plastic"));
    }
}
